﻿using System;
using System.Text;

namespace Hongsh.Pay.Client.Proxy.Http {
    // Token: 0x02000030 RID: 48
    public class HttpTextResult : HttpBufferResult {
        // Token: 0x17000094 RID: 148
        // (get) Token: 0x06000167 RID: 359 RVA: 0x00002F8C File Offset: 0x0000118C
        public virtual string Text { get; }

        // Token: 0x17000095 RID: 149
        // (get) Token: 0x06000168 RID: 360 RVA: 0x00002F94 File Offset: 0x00001194
        public Encoding Encoding { get; }

        // Token: 0x17000096 RID: 150
        // (get) Token: 0x06000169 RID: 361 RVA: 0x00002F9C File Offset: 0x0000119C
        public override byte[] Buffer {
            get {
                return Encoding.GetBytes(Text);
            }
        }

        // Token: 0x0600016A RID: 362 RVA: 0x00002FAF File Offset: 0x000011AF
        public HttpTextResult(string text, string content_type = "text/plain") : this(Encoding.UTF8, text, content_type) {
            //Class15.cwcZ3SWztHroi();
            //this..ctor(Encoding.UTF8, text, content_type);
        }

        // Token: 0x0600016B RID: 363 RVA: 0x00002FC3 File Offset: 0x000011C3
        public HttpTextResult(Encoding encoding, string text, string content_type = "text/plain") : base(content_type + "; charset=" + encoding.HeaderName) {
            //Class15.cwcZ3SWztHroi();
            //base..ctor(content_type + "; charset=" + encoding.HeaderName);
            Text = text;
            Encoding = encoding;
        }
    }
}
